extensions/fast-float: reduce precision
authorØyvind Kolås <pippin@gimp.org>
Sun, 1 Apr 2012 14:03:10 +0000 (15:03 +0100)
committerØyvind Kolås <pippin@gimp.org>
Sun, 1 Apr 2012 14:03:10 +0000 (15:03 +0100)
Reduce sizes of lookup tables by an order of magnitude, doubling the run-time
performance.

extensions/fast-float.c

index 2d0293181ea5c1399943c8ba55c28857d1aee6e0..77ca6337c46cf3a23563d3d8bfa4b6c53e496fa6 100644 (file)
@@ -199,6 +199,11 @@ babl_lookup_new (BablLookupFunction function,
                                                   ((positive_max-positive_min)+
                                                    (negative_max-negative_min)), 1);
 
+  printf ("%i\n",
+            sizeof (BablLookup) + sizeof (float) *
+                                                  ((positive_max-positive_min)+
+                                                   (negative_max-negative_min)));
+
   lookup->positive_min = positive_min;
   lookup->positive_max = positive_max;
   lookup->negative_min = negative_min;
@@ -438,8 +443,8 @@ init (void)
     float f;
     float a;
 
-    fast_pow = babl_lookup_new (core_lookup, NULL, 0.0, 1.0,   0.00001);
-    fast_rpow = babl_lookup_new (core_rlookup, NULL, 0.0, 1.0, 0.00001);
+    fast_pow = babl_lookup_new (core_lookup, NULL, 0.0, 1.0,   0.0001);
+    fast_rpow = babl_lookup_new (core_rlookup, NULL, 0.0, 1.0, 0.0001);
 
     for (f = 0.0; f < 1.0; f+= 0.000001)
       {